<%@page import="com.soda.bean.Menu"%>
<%@page import="com.soda.bean.Fmenu"%>
<%@page import="com.soda.bean.User"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>soda创业教育平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="StyleSheet" href="css/dtree.css" type="text/css" />
<script type="text/javascript" src="js/dtree.js"></script>
</head>
<body scroll="no">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="79" background="images/top_bg.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="500"><img src="images/top_left.jpg" width="500" height="79"></td>
          <td>&nbsp;</td>
          <td width="500" height="79"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><img src="images/top_right_a.gif" width="500" height="47"></td>
              </tr>
              <tr>
                <td><table width="500" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="150"><img src="images/top_right_b1.gif" width="150" height="32"></td>
                    <td width="146" height="32" background="images/top_right_b2.gif" class="white">用户：${sessionScope.user.useLoginName }</td>
                    <td width="74"><a  target="page"><img src="images/top_right_b6.gif" width="74" height="32" border="0"></a></td>
                    <td width="50"><a href="<%=request.getContextPath() %>/UserServlet?param=xiaohui"><img src="images/top_right_b3.gif" width="50" height="32" border="0"></a></td>
                    <td width="50"><a href="#"><img src="images/top_right_b4.gif" width="50" height="32" border="0"></a></td>
                    <td width="30"><img src="images/top_right_b5.gif" width="30" height="32"></td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td height="100%"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" style="background-repeat: repeat-x;">
        <tr>
          <td width="175" height="100%" valign="top"><table width="175" height="100%" border="0" cellspacing="0" cellpadding="0" background="images/menu_bg.gif">
              <tr>
                <td height="25"><img src="images/menu_top.gif" width="175" height="25"></td>
              </tr>
              <tr>
                <td height="100%" style="background-image:url(images/menu_bgT.gif); background-repeat:no-repeat" valign="top"><div class="dtree">
                    <script type="text/javascript">
					d = new dTree('d');
					d.config.stepDepth = 1;
					d.config.useStatusText = true;
					 
					d.add(0,-1,' <strong>后台管理</strong>');
					
					
					<%
						User u=(User)session.getAttribute("user");
					if(u!=null){
						List<Fmenu> fmenus=(List<Fmenu>)u.getRole().getFmenus();
						
						for(int i=0;i<fmenus.size();i++){//遍历父级菜单
							Fmenu fm=fmenus.get(i);
							out.print("d.add("+(i+1)+",0,'"+fm.getFmeName()+"');");
							List<Menu> menus=(List<Menu>)u.getRole().getMenus();
							for(int j=0;j<menus.size();j++){//遍历子级菜单
								Menu m=menus.get(j);
							if(m.getFmenu().getFmeId()==fm.getFmeId()&&m.getMenState()==1&&m.getMenDelete()==1){
							     String p=request.getContextPath();
								out.print("d.add('"+(100+j+1)+"','"+(i+1)+"','"+m.getMenName()+"','"+(p+m.getMenUrl())+"','"+""+"','page');");
							}
							}
							
						}
					}
					%>
					/* 
					d.add(5,0,'权限管理');
					d.add(501,5,'人员管理','',"",'page');
					
					
					d.add(1,0,'系统管理');
					d.add(101,1,'新闻管理','pages/newconter/index.jsp',"",'page');
					d.add(102,1,'公告管理','pages/afficheManage/index.jsp',"",'page');
							
					d.add(103,1,'资讯管理','pages/publicityManage/poineerMessage/index.jsp',"",'page');
					d.add(104,1,'行业介绍','pages/publicityManage/classManage/index.jsp',"",'page');
					d.add(105,1,'概况管理','pages/publicityManage/synopsis.jsp',"",'page');
					d.add(106,1,'关于我们','pages/publicityManage/onePageManage/concerningUs.jsp',"",'page');
					d.add(107,1,'版权声明','pages/publicityManage/onePageManage/copyrightState.jsp',"",'page');
					d.add(108,1,'联系我们','pages/publicityManage/onePageManage/relationUs.jsp',"",'page');
					
					
					d.add(4,0,'课程管理');
					d.add(401,4,'课程管理','pages/class/list.jsp',"",'page');
					d.add(402,4,'学生管理','pages/stu/list.jsp',"",'page');
					
					
					
					d.add(502,5,'角色管理','pages/role/list.jsp',"",'page');
					d.add(503,5,'菜单管理','pages/menu/list.jsp',"",'page');
					
					
					
					d.add(6,0,'个人信息管理');
					d.add(601,6,'修改密码','pages/personalManager/updatePs.jsp',"",'page');
					d.add(602,6,'个人信息','pages/personalManager/detail.jsp',"",'page'); */
					document.writeln(d);
					</script>
                </div></td>
              </tr>
              <tr>
                <td height="31"><img src="images/menu_foot.gif" width="175" height="31"></td>
              </tr>
            </table></td>
          <td><iframe src="pages/personalManager/detail.jsp" width="100%" height="100%" frameborder="0" scrolling="no" name="page"></iframe></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>